package cn.maihe.elg.operation.repository.mapper;

import cn.maihe.elg.operation.repository.entity.UserDO;
import cn.maihe.elg.operation.repository.entity.entityCustom.UserDOCustom;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper extends BaseMapper<UserDO> {
    List<UserDOCustom> findByUsername(@Param("username") String username);

    List<UserDOCustom> findByUsernameLikeOrNameLike(@Param("username") String username,
                                                    @Param("name") String name,
                                                    @Param("status") String status,
                                                    @Param("orgCode") String orgCode,
                                                    @Param("type") Integer type);

    int insertUserRoles(@Param("roles") List<Long> roles, @Param("userId") Long userId);

    List<String> findPermByUserId(Long userId);

    UserDOCustom selectByIdCustom(Long id);

    void insertUserRole(@Param("type") int type, @Param("userId") Long userId);

    List<Long> getCenterIds(@Param("userId") String userId);

    List<Long> getInstitutionIds(@Param("userId") String userId);
}
